<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: red;
        }
        
        h1 {
            width: 50px;
            height: 50px;
            background: green;
        }
    </style>
</head>

<body>
    <div id="div">
        <h1 id="h1">h1</h1>
    </div>

    <script>
        // function fn() {
        //     console.log(this.id)
        // }
        // console.log(span.clientHeight)
        // console.log(div.clientHeight)

        // console.log(p.scrollHeight)
        // console.log(p.clientHeight)

        h1.onclick = function(e) {
            e.stopPropagation();
            alert('inner')
        }

        div.onclick = function(e) {
            alert("outer")
        }
    </script>
</body>

</html>